From e00ef950ed6347375abfb4597a56b5d3b7fa4748 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 14 Nov 2005 18:49:41 +0000 Subject: [PATCH] Avoid a crash --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gtk/gtkicontheme.c | 11 ++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9e61bb032..1a24006a1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-14 Matthias Clasen + + * gtk/gtkicontheme.c (gtk_icon_theme_get_icon_sizes): + Don't crash if there is no builtin icon. + 2005-11-14 Michael Natterer * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_set_property): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b9e61bb032..1a24006a1e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-11-14 Matthias Clasen + + * gtk/gtkicontheme.c (gtk_icon_theme_get_icon_sizes): + Don't crash if there is no builtin icon. + 2005-11-14 Michael Natterer * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_set_property): diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index bfce170709..2e9ef1f3e0 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1517,12 +1517,13 @@ gtk_icon_theme_get_icon_sizes (GtkIconTheme *icon_theme, { icons = g_hash_table_lookup (icon_theme_builtin_icons, icon_name); - for ( ; icons; icons = icons->next); - { - BuiltinIcon *icon = icons->data; + while (icons) + { + BuiltinIcon *icon = icons->data; - g_hash_table_insert (sizes, GINT_TO_POINTER (icon->size), NULL); - } + g_hash_table_insert (sizes, GINT_TO_POINTER (icon->size), NULL); + icons = icons->next; + } } r = result = g_new0 (gint, g_hash_table_size (sizes) + 1); -- 2.30.2